<?php

namespace Framework;

use Framework\Session;

/**
 * 授权类
 */
class Authorisation
{
    public static function isOwner($resourceId)
    {
        //从会话中获取用户信息
        $sessionUser = Session::get('user');
        //检查ID是否设置
        if($sessionUser !== null && isset($sessionUser['id']))
        {
            $sessionUserId = (int) $sessionUser['id'];
            return $sessionUserId == $resourceId;
        }
            return false;
    }
}